package com.nc.delivery_project.server.domain;

/**
 * Created by miroshnik on 01.12.14.
 * Edit by DRAGON on 24.01.14 -> postalCode,address -> null
 */
public class Department {
	
    private int deptId;

    private String address;

    private String postalCode;

    private City city;

    private StateProvince stateprovince;

    private Country country;

	public Department() {
	}

	public Department(int deptId) {
		super();
		this.deptId = deptId;
	}

	public Department(int deptId, String address, String postalCode, City city) {
		this(deptId, address, postalCode);
		this.city = city;
	}

	public Department(int deptId, String address, String postalCode) {
		this(deptId);
		this.address = address;
		this.postalCode = postalCode;
		
	}

	public int getDeptId() {
		return deptId;
	}

	public void setDeptId(int dept_id) {
		this.deptId = dept_id;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}



	public String getPostalCode() {
		return postalCode;
	}



	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}


	public City getCity() {
		return city;
	}



	public void setCity(City city) {
		this.city = city;
	}
	
	public StateProvince getStateProvince() {
		return stateprovince;
	}

	public void setStateProvince(StateProvince state) {
		this.stateprovince = state;
	}
 

	
	@Override
	public boolean equals(Object o) {
	      if (this == o) return true;
	      if (!(o instanceof Department)) return false;

	      Department dept = (Department) o;
	        if (address!=null?!address.equals(dept.address): dept.address!= null) return false;
	        if (postalCode!= null? !postalCode.equals(dept.postalCode):dept.postalCode!=null) return false;
	        if (city != null?!city.equals(dept.city):dept.city!=null) return false;

	        return true;
	    }

	    @Override
	    public int hashCode() {
	        int result = deptId;
	        result = 31 * result + (address != null ? address .hashCode(): 0);
	        result = 31 * result + (postalCode != null ? postalCode.hashCode(): 0);
	        result = 31 * result + (city != null ? city.hashCode() : 0);
	        return result;
	    }

	    @Override
	    public String toString() {
	        final StringBuilder sb = new StringBuilder("Department{");
	        sb.append("deptId=").append(deptId);
	        sb.append(", address='").append(address).append('\'');
	        sb.append(", postalCode='").append(postalCode).append('\'');
	        sb.append(", city=").append(city);
	        sb.append('}');
	        return sb.toString();
	    }

		public Country getCountry() {
			return country;
		}

		public void setCountry(Country country) {
			this.country = country;
		}



    
}
